home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 650 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.7 KB  |  57 lines

  1. Newsgroups: comp.graphics.algorithms,comp.lang.c++,comp.os.ms-windows.programmer.graphics,comp.os.ms-windows.programmer.multimedia,comp.os.ms-windows.programmer.win32
  2. Path: netcom.com!tgl
  3. From: tgl@netcom.com (Tom Lane)
  4. Subject: Re: IJG JPEG Engine and Win32
  5. Message-ID: <TGL.96Jan5065424@netcom21.netcom.com>
  6. Sender: tgl@netcom21.netcom.com
  7. Organization: Netcom Online Communications Services
  8. References: <4cemir$6vb@redstone.interpath.net> <TGL.96Jan3202549@netcom21.netcom.com>
  9.     <4cj5ct$nth@redstone.interpath.net>
  10. Date: Fri, 5 Jan 1996 14:54:24 GMT
  11.  
  12. fortunat@interpath.com (Jumpstile Turner) writes:
  13. > tgl@netcom.com said:
  14. >> * Compiling them with different declarations for "boolean".  The IJG
  15. >> code by default defines boolean = int, but Windows prefers
  16. >> boolean = unsigned char.
  17.  
  18. >   Well I think this is my problem.  I don't know how to go about fixing it 
  19. > though.  Being as my application is a GUI application I NEED to include the 
  20. > windows.h file, so "BOOLEAN" will be defined as an unsigned char, however 
  21. > "boolean" is defined in one of the jpeglib includes as int.
  22.  
  23. Just change the definition of boolean in jmorecfg.h.  There's specific
  24. advice to do that for Windows apps in install.doc, btw.
  25.  
  26. > Incidently as of right now I converted all the stdlib functions into Windows 
  27. > API functions (i.e. CreateFile instead of fopen, ReadFile instead of the 
  28. > JFREAD macro, HeapAlloc instead of malloc) and everything appears to work 
  29. > until I try to allocate a buffer with the jpeglib's memory allocation 
  30. > functions.  Then I get an invalid page fault.
  31.  
  32. Hm.  That one I don't have an answer for offhand.  Which memory manager
  33. back end are you using --- jmemnobs.c, or something more complex?
  34.  
  35. > Oh yes, and lastly, with the borland BCC32 command line compiler, jdmerge.c 
  36. > will not compile.  I get an internal backend C1107 error at line 280.  This 
  37. > seems like a bug in the borland compiler.
  38.  
  39. Yes, it is.  Here's the latest dope from the current version of install.doc:
  40.  
  41.  
  42. Borland C++ 4.5 fails with an internal compiler error when trying to compile
  43. jdmerge.c in 32-bit mode.  If enough people complain, perhaps Borland will fix
  44. it.  In the meantime, the simplest known workaround is to add a redundant
  45. definition of the variable range_limit in h2v1_merged_upsample(), at the head
  46. of the block that handles odd image width (about line 268 in v6 jdmerge.c):
  47.   /* If image width is odd, do the last output column separately */
  48.   if (cinfo->output_width & 1) {
  49.     register JSAMPLE * range_limit = cinfo->sample_range_limit; /* ADD THIS */
  50.     cb = GETJSAMPLE(*inptr1);
  51. Pretty bizarre, especially since the very similar routine h2v2_merged_upsample
  52. doesn't trigger the bug.
  53.  
  54.  
  55.             regards, tom lane
  56.             organizer, Independent JPEG Group
  57.